package com.android.baseconfig.data.http.retrofit2.exception;

import com.android.baseconfig.R;
import com.android.baseconfig.data.http.AppNetDelegate;

/**
 * ————————————————————————————————
 * Copyright (C) 2014-2017, by het, Shenzhen, All rights reserved.
 * ————————————————————————————————
 * <p>
 * <p>描述：</p>
 * 名称:  <br>
 * 作者: uuxia<br>
 * 版本: 1.0<br>
 * 日期: 2017/2/22 12:50<br>
 **/
public final class HttpErrorCode {
    /**
     * 未知错误
     */
    public static final int UNKNOWN = 1000;

    public static final String UNKNOWN_STRING = AppNetDelegate.getAppContext().getString(R.string.common_basic_UNKNOWN_STRING);
    /**
     * 解析错误
     */
    public static final int PARSE_ERROR = 1001;
    public static final String PARSE_ERROR_STRING =  AppNetDelegate.getAppContext().getString(R.string.common_basic_PARSE_ERROR_STRING);
    /**
     * 网络错误
     */
    public static final int NETWORD_ERROR = 1002;
    public static final String NETWORD_ERROR_STRING = AppNetDelegate.getAppContext().getString(R.string.common_basic_NETWORD_ERROR_STRING);
    /**
     * 协议出错
     */
    public static final int HTTP_ERROR = 1003;

    /**
     * 证书出错
     */
    public static final int SSL_ERROR = 1005;
    public static final String SSL_ERROR_STRING = AppNetDelegate.getAppContext().getString(R.string.common_basic_SSL_ERROR_STRING);

    /**
     * 连接超时
     */
    public static final int TIMEOUT_ERROR = 1006;
    public static final String TIMEOUT_ERROR_ERRORSTRING = AppNetDelegate.getAppContext().getString(R.string.common_basic_TIMEOUT_ERROR_ERRORSTRING);

    public final static class HttpStatusCode {
        //对应HTTP的状态码
        public static final int UNAUTHORIZED = 401;
        public static final String UNAUTHORIZED_STRING =  AppNetDelegate.getAppContext().getString(R.string.common_basic_UNAUTHORIZED_STRING);
        public static final int FORBIDDEN = 403;
        public static final String FORBIDDEN_STRING =  AppNetDelegate.getAppContext().getString(R.string.common_basic_FORBIDDEN_STRING );
        public static final int NOT_FOUND = 404;
        public static final String NOT_FOUND_STRING = AppNetDelegate.getAppContext().getString(R.string.common_basic_NOT_FOUND_STRING );
        public static final int REQUEST_TIMEOUT = 408;
        public static final String REQUEST_TIMEOUT_STRING = AppNetDelegate.getAppContext().getString(R.string.common_basic_REQUEST_TIMEOUT_STRING );
        public static final int INTERNAL_SERVER_ERROR = 500;
        public static final String INTERNAL_SERVER_ERROR_STRING = AppNetDelegate.getAppContext().getString(R.string.common_basic_INTERNAL_SERVER_ERROR_STRING);
        public static final int BAD_GATEWAY = 502;
        public static final String BAD_GATEWAY_STRING = AppNetDelegate.getAppContext().getString(R.string.common_basic_BAD_GATEWAY_STRING );
        public static final int SERVICE_UNAVAILABLE = 503;
        public static final String SERVICE_UNAVAILABLE_STRING =  AppNetDelegate.getAppContext().getString(R.string.common_basic_SERVICE_UNAVAILABLE_STRING );
        public static final int GATEWAY_TIMEOUT = 504;
        public static final String GATEWAY_TIMEOUT_STRING = AppNetDelegate.getAppContext().getString(R.string.common_basic_GATEWAY_TIMEOUT_STRING);
        public static final String UNKNOW_STRING = AppNetDelegate.getAppContext().getString(R.string.common_basic_UNKNOW_STRING );
        public static final String SERVER_ERROR_TRY = AppNetDelegate.getAppContext().getString(R.string.common_basic_SERVER_ERROR_TRY );;  //统一处理服务器返回异常
    }
}
